unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    function CutTag(SourceStr:string;Tag:string):string;
  end;

var
  Form1: TForm1;
const
  Fields ='[ID], [code], [Alt_Code], [Alt_ID], [AlterationType_Code], [Ass_ID], [CardID], [AssetsType], [AssetSortCodes], [AssetsTypeID],'
         +' [zjnx], [SerialNum], [SerialCode], [AssetsMeasure], [AssetsName], [AssetsStandard], [AssetsUseDate], [AssetsEndUseDate], [YearCount], [UseState], [DpreciationType], [AssetsLayAdd], [AssetsUser], [AssetsDept], [AssetsPrice], [DpreciationAdd], [LeftPrice],'
         +' [GroundArea], [GroundRegPerson], [GroundPropCode], [GroundPropDate], [GroundRegisterArea], [GroundAssetsType], [GroundFundFrom], [PropModality], [AssetsUseWayType], [AssetsUseWay], [AssetsUseWay0], [AssetsUseWay1], [hackLendsID1], [AssetsUseWay2], '
         +' [hackLendsID2], [AssetsUseWay3], [AssetsUseWay4], [AssetsUseWay5], [GroundManageDept], [GroundSetPos], [GroundProp], [AssetsCulGrade], [AssetsProdArea], [VehicleNo], [AssetsdispenseDate], [AssetsManager], [AssetsFactoryNO], [VehExh], [LongMiles],'
         +' [VehPurpose], [AssetsOrganization], [AssetsNum], [HouseStructure], [HouseBuildArea], [UnitBearArea], [ComputerRoomArea], [MeetingRoomArea], [CarbarnArea], [EateryArea], [DistributionRoomArea], [HouseUseArea], [basementArea], [basementUseArea],'
         +' [AssetsUseDate2], [HouseDeliverDate], [UseingDate], [AssetsWriter], [AssetsWriterDate], [AssetsChecker], [AssetsCheckerDate], [PicName], [CheckAccounts], [DisposalMode], [GetMode], [Remarks], [State], [AssetCardEndDate], [BusinessTag],'
         +' [KJQJ_BH], [financeDate], [AssetBarCode], [Businessdate], [KJND_BH], [Assets_Tag], [Assets_YJCZ]';


implementation

{$R *.dfm}

function TForm1.CutTag(SourceStr, Tag: string): string;
var
  I:integer;
begin
  I:=Pos(Tag,SourceStr);
 // Showmessage(inttostr(I));
  while I > 0 do
  begin
    Delete(SourceStr,I,1);
   // Showmessage(SourceStr) ;
    I:=Pos(Tag,SourceStr);
  end;
  Result:=SourceStr;
end;

procedure TForm1.Button1Click(Sender: TObject);
var
  Temp:string;
begin
  Temp:=CutTag(Fields,'[');
  Showmessage(Temp);
  Temp:=CutTag(Temp,']');
  Showmessage(Temp);
end;

end.
